package com.ofhb.entities;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@SuppressWarnings("serial")
@Entity
@Table(name="hall_booking")
public class HallBookingEntity implements Serializable{
	/*
	  id serial NOT NULL,
	  start_time timestamp with time zone NOT NULL,
	  end_time timestamp with time zone NOT NULL,
	  customer_id integer,
	  hall_id integer,
	  active boolean NOT NULL DEFAULT true,
	*/
	@Id
	@Column(name = "id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	@Column(name = "start_time")
	@Temporal(value = TemporalType.DATE)
	private Date startTime;
	
	@Column(name = "end_time")
	@Temporal(value = TemporalType.DATE)
	private Date endTime;
	
	@ManyToOne(cascade= CascadeType.ALL)
	@JoinColumn(name="customer_id", referencedColumnName ="id", updatable=true)
	private UserEntity userEntity;
	
	@ManyToOne(cascade= CascadeType.ALL)
	@JoinColumn(name="hall_id", referencedColumnName ="id", updatable=true)
	private HallEntity hallEntity;
	
	@Column(name = "active")
	private Boolean active;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public UserEntity getUserEntity() {
		return userEntity;
	}

	public void setUserEntity(UserEntity userEntity) {
		this.userEntity = userEntity;
	}

	public HallEntity getHallEntity() {
		return hallEntity;
	}

	public void setHallEntity(HallEntity hallEntity) {
		this.hallEntity = hallEntity;
	}

	public Boolean getActive() {
		return active;
	}

	public void setActive(Boolean active) {
		this.active = active;
	}
}
